#pragma once
#include "umtl/parallel/thread.hpp"
#include "umtl/smart_ptr/smart_ptr.hpp"
#include "umtl/memory_stream/memory_stream.h"
#include <vector>
#include <array>
#include "send_packet_stream.h"




class send_packet_pool
{
public:
	typedef send_packet_stream::ptr stream_ptr;
	typedef std::vector< stream_ptr > pool_t;
	typedef umtl::parallel::critical_section::section_locker locker;

	static send_packet_pool& instance();

	stream_ptr pop();
	void push( stream_ptr packet );

private:
	umtl::parallel::critical_section ct_;
	pool_t pool_;

	send_packet_pool() {}
	send_packet_pool(send_packet_pool const&);
};